package com.lc.recovery.ui.activity.warehousemine;

import android.os.Bundle;
import android.widget.TextView;

import com.hjq.http.EasyHttp;
import com.hjq.http.listener.HttpCallback;
import com.lc.recovery.R;
import com.lc.recovery.app.AppActivity;
import com.lc.recovery.http.request.StoragelogShowApi;
import com.lc.recovery.http.response.StoragelogShowBean;

import butterknife.BindView;
import butterknife.ButterKnife;

public class PutInDetailsActivity extends AppActivity {


    @BindView(R.id.tv_date)
    TextView tvDate;
    @BindView(R.id.tv_type)
    TextView tvType;
    @BindView(R.id.tv_weight)
    TextView tvWeight;
    @BindView(R.id.tv_difference)
    TextView tvDifference;
    @BindView(R.id.tv_personnel)
    TextView tvPersonnel;
    @BindView(R.id.tv_chae)
    TextView tvChae;
    @BindView(R.id.tv_shifu)
    TextView tvShifu;
    private String id;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_putindetails;
    }

    @Override
    protected void initView() {

    }

    @Override
    protected void initData() {

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
        id = getIntent().getStringExtra("id");
        storage_log_show();
    }

    private void storage_log_show() {
        EasyHttp.post(this)
                .api(new StoragelogShowApi().setId(id)).request(new HttpCallback<StoragelogShowBean>(this) {

            @Override
            public void onSucceed(StoragelogShowBean data) {
                if (data.getCode() == 200) {
                 tvType.setText(data.getData().getShops());
                 tvDate.setText(data.getData().getCreate_time());
                 tvDifference.setText(data.getData().getDifference_weights());
                 tvPersonnel.setText(data.getData().getWorker());
                 tvShifu.setText("实付款：￥"+data.getData().getAmount());
                 tvChae.setText("差额款：￥"+data.getData().getDifference_money());

                } else {
                    toast(data.getMsg());
                }
            }


            @Override
            public void onFail(Exception e) {
                super.onFail(e);

            }
        });
    }
}
